//
//  MKUIElementListViewCellSwitch+Test.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2023/11/10.
//  Copyright © 2023 moon. All rights reserved.
//

#import "MKUIElementListViewCellSwitch+Test.h"

@implementation MKUIElementListViewCellSwitch (Test)
+ (MKUIElementListViewCellSwitch *)testSwitchElementWithTitle:(NSString *)title on:(BOOL)on whenChange:(void(^)(BOOL on))block{
    MKUIElementListViewCellSwitch *el = [[MKUIElementListViewCellSwitch alloc] init];
    el.elementView.titleText = title;
    el.elementView.on = on;
    el.elementView.whenChange = ^(MKUIElementViewSwitch * _Nonnull el, BOOL on) {
        if(!block)return;
        block(on);
    };
    return el;
}
@end
